import {FormRuleUtil} from "@/utils";

// 场地管理
export const PLACE_EDIT = {
    BODY: {
        code: '',
        name: '',
        status: '',
        address: {},
        describe: '',
        sort: 0

    },
    RULES: {
        code: FormRuleUtil.strRule("场地代码", true, 30),
        name: FormRuleUtil.strRule("场地名称", true, 10),
        status: FormRuleUtil.strRule("场地状态", true, 10),
        address: FormRuleUtil.strRule("场地地址", true, 10),
        describe: FormRuleUtil.strRule("场地描述", true, 10),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}

export const PIGSTY_EDIT = {
    BODY: {
        cameraCode: [],
        name: '',
        code: '',
        kind: '',
        place: {code: ""},
        status: '',
        number: 5,
        sort: 0 ,
        isOrganic:false

    },
    RULES: {
        cameraCode: FormRuleUtil.arrayRule("摄像头", true),
        name: FormRuleUtil.strRule("猪圈名称", true, 10),
        code: FormRuleUtil.strRule("猪圈代码", true, 10),
        kind: FormRuleUtil.strRule("猪圈类型", true, 10),
        place: {code: FormRuleUtil.strRule("所属场地", true, 10)},
        status: FormRuleUtil.strRule("猪圈状态", true, 10),
        number: FormRuleUtil.numRule("猪圈容量", true, 1, 99999),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
        isOrganic: FormRuleUtil.boolRule("是否是有机猪圈", true),
    }
}

export const BREED_EDIT = {
    BODY: {
        code: '',
        name: '',
        describe: '',
        isOrganic: false,
        image: '',
        sort: 0

    },
    RULES: {
        code: FormRuleUtil.arrayRule("品种代码", true),
        name: FormRuleUtil.strRule("品种名称", true, 10),
        kill: FormRuleUtil.numRule("宰杀天数", true, 0, 99999),
        describe: FormRuleUtil.strRule("品种描述", true),
        isOrganic: FormRuleUtil.boolRule("是否有机", true),
        image: FormRuleUtil.strRule("品种图片", true),
        enterAge: FormRuleUtil.numRule("入栏日龄", true, 0, 99999),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}


export const RFID_EDIT = {
    BODY: {
        name: '',
        beaconMac: '',
    },
    RULES: {
        code: FormRuleUtil.strRule("耳标名称", true),
        name: FormRuleUtil.strRule("蓝牙耳标mac", true),
    }
}

export const LEVEL_EDIT = {
    BODY: {
        levelNum: '',
        day: 0,
        kind: '',
        stage: '',
        weight: 0,
        allowKill: false,
        msg: '',
        breed: {code: ''},

    },
    RULES: {
        levelNum: FormRuleUtil.strRule("等级序号", true),
        day: FormRuleUtil.numRule("成长天数", true, 0, 9999),
        stage: FormRuleUtil.strRule("所属阶段", true),
        kind: FormRuleUtil.strRule("喂养类型", true),
        weight: FormRuleUtil.numRule("预估体重KG", true, 0, 999),
        allowKill: FormRuleUtil.boolRule("是否允许宰杀", true),
        msg: FormRuleUtil.strRule("喂养提示语", true),
        breed: {code: FormRuleUtil.strRule("适用品种", true)},

    }
}


export const PROFILE_EDIT = {
    BODY: {
        code: '',
        name: '',
        price: 0,
        icon: '',

        sort: 0,
        description: ''

    },
    RULES: {
        code: FormRuleUtil.strRule("食物代码", true),
        name: FormRuleUtil.strRule("食物名称", true, 10),
        description: FormRuleUtil.strRule("实物描述", true, 200),
        price: FormRuleUtil.numRule("售价金币", true, 0, 99999),
        icon: FormRuleUtil.strRule("档案图标", true),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}


export const COMBO_EDIT = {
    BODY: {
        code: '',
        name: '',
        price: 0,
        isOrganic:false ,
        discountPrice: 0,
        isPack: false,
        meat: [],
        icon: '',
        minLevel: 0,
        maxLevel: 0,
        stock: 0,

        status: '',
        sort: 0
    },
    RULES: {
        isOrganic: FormRuleUtil.boolRule("有机属性", true),
        code: FormRuleUtil.strRule("套餐代码", true),
        name: FormRuleUtil.strRule("套餐名称", true, 10),
        price: FormRuleUtil.numRule("售价金币", true, 0, 99999),
        discountPrice: FormRuleUtil.numRule("折扣金币", true, 0, 99999),
        meat: FormRuleUtil.arrayRule("套餐档案", true),
        icon: FormRuleUtil.strRule("档案图标", false),
        minLevel: FormRuleUtil.numRule("最低食用等级", true, 0, 999),
        maxLevel: FormRuleUtil.numRule("最高食用等级", true, 0, 999),
        stock: FormRuleUtil.numRule("食物库存", true, 0, 99999),
        status: FormRuleUtil.strRule("食物状态", true),

        isPack: FormRuleUtil.boolRule("是否是套餐包", true),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}

export const SEARCH_EDIT = {
    BODY: {
        code: '',
        name: '',
        price: 0,
        icon: '',
        description: '',
        title: '',
        task: '',
        day: 0,
        status: '',
        sort: 0

    },
    RULES: {
        code: FormRuleUtil.strRule("服务代码", true),
        name: FormRuleUtil.strRule("服务名称", true),
        price: FormRuleUtil.numRule("售价金币", true, 0, 99999),
        icon: FormRuleUtil.strRule("档案图标", true),
        description: FormRuleUtil.strRule("描述", true),
        title: FormRuleUtil.strRule("触发任务标题", true),
        task: FormRuleUtil.strRule("任务描述", true),
        day: FormRuleUtil.numRule("触发任务时效", true, 0, 99999),
        status: FormRuleUtil.strRule("服务状态", true),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}

export const SNACKS_EDIT = {
    BODY: {
        code: '',
        name: '',
        energy: 0,
        icon: '',
        description: '',
        weight: '',
        status: '',
        sort: 0

    },
    RULES: {
        code: FormRuleUtil.strRule("零食代码", true),
        name: FormRuleUtil.strRule("零食名称", true),
        energy: FormRuleUtil.numRule("兑换能量", true, 0, 99999),
        icon: FormRuleUtil.strRule("零食图标", true),
        description: FormRuleUtil.strRule("零食说明", true),
        weight: FormRuleUtil.numRule("配比重量(克)", true,0,99999),
        status: FormRuleUtil.strRule("售卖状态", true),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}

export const CAMERA_EDIT = {
    BODY: {
        deviceName: '',
        deviceSerial: '',
        osdName: '',
    },
    RULES: {
        deviceName: FormRuleUtil.strRule("设备名称", false),
        deviceSerial: FormRuleUtil.strRule("设备编号", false),
        osdName: FormRuleUtil.strRule("osd名称", false),
    }
}
export const DETAIL_EDIT = {
    BODY: {
        channelName: '',
        cameraDirection: '',
        videoLocation: '',
    },
    RULES: {
        channelName: FormRuleUtil.strRule("摄像头名称", true),
        cameraDirection: FormRuleUtil.strRule("摄像头位置", true),
        videoLocation: FormRuleUtil.strRule("摄像头编码", true),
    }
}

export const GOODS_EDIT = {
    BODY: {
        code: '',
        name: '',
        mode: 'ALONE',
        breed: {code: ''},
        dayNum: 30,
        showPrice: 0,
        price: 0,
        fullPrice: 0,
        egg: 0,
        month: 0,
        chicken: 0,
        weight: 0,
        deduction: 0,
        insurance: 0,
        accident: 0,
        reserveFund: 0,
        promotion: false,
        isExchange: false,
        msg: '',
        stage: '',
        stock: 0,
        status: '',
        introduce: '',
        sort: 0,
    },
    RULES: {
        code: FormRuleUtil.strRule("商品代码", true),
        name: FormRuleUtil.strRule("商品名称", true),
        mode: FormRuleUtil.strRule("喂养模式", true),
        breed: {code: FormRuleUtil.strRule("猪仔档案", true)},
        dayNum: FormRuleUtil.numRule("商品图片", true),
        promotion: FormRuleUtil.boolRule("是否促销", true),
        isExchange: FormRuleUtil.boolRule("是否可兑换", true),
        showPrice: FormRuleUtil.numRule("显示价格", false),
        weight: FormRuleUtil.numRule("猪仔重量", true),
        price: FormRuleUtil.numRule("销售价格", true),
        fullPrice: FormRuleUtil.numRule("全额价格", true),
        month: FormRuleUtil.numRule("包含月份", true),
        stage: FormRuleUtil.strRule("所属阶段", true),
        chicken: FormRuleUtil.numRule("全额认养(鸡)", true),
        egg: FormRuleUtil.numRule("全额认养(蛋)", true),
        deduction: FormRuleUtil.numRule("钻石抵扣金额", true),
        insurance: FormRuleUtil.numRule("疾病险", true),
        accident: FormRuleUtil.numRule("养猪险", true),
        reserveFund: FormRuleUtil.numRule("猪仔备用金", true),
        msg: FormRuleUtil.strRule("促销标语", false),
        introduce: FormRuleUtil.strRule("商品介绍", false),
        stock: FormRuleUtil.numRule("销售库存", true),
        status: FormRuleUtil.strRule("销售状态", true),
        sort: FormRuleUtil.numRule("显示排序", true, 0, 100),
    }
}


